package com.orion.config;

import org.springframework.web.filter.OncePerRequestFilter;

import javax.servlet.FilterChain;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.Arrays;

/**
 * @author Administrator
 * @date 2021/9/28
 */
public class CustomFilter2222 extends OncePerRequestFilter {
    @Override
    protected void doFilterInternal(HttpServletRequest httpServletRequest,
                                    HttpServletResponse httpServletResponse,
                                    FilterChain filterChain) throws ServletException, IOException {
        System.out.println("in custom Filter for oauth233333333 server");
        System.out.println("httpServletRequest Param 4444444444: {");
        httpServletRequest.getParameterMap().forEach((k,v) -> System.out.println("  Key = " + k
                + " : value = " + Arrays.toString(v)));
        System.out.println("}");
        System.out.println("httpServletRequest URI 44444444: " + httpServletRequest.getRequestURI());

        filterChain.doFilter(httpServletRequest, httpServletResponse);
    }
}
